<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
  <link rel="stylesheet" href="../css/index.css">
  <title>次卡详情</title>
</head>

<body class="appointment page-group">
  <div class="page">
    <!-- //<header class="bar bar-nav" id="golbalHeader"></header> -->

    <!-- 这里是页面内容区 -->
    <div class="content">
      <!-- <div class="pull-to-refresh-layer">
        <div class="preloader"></div>
        <div class="pull-to-refresh-arrow"></div>
      </div> -->

      <div class="list-block">
        <ul>
          <li class="item-content">
            <div class="item-media">
              <i class="icon icon-f7"></i>
            </div>
            <div class="item-inner">
              <div class="item-title">次卡名称</div>
              <div class="item-after" id="name"></div>
            </div>
          </li>
          <li class="item-content">
            <div class="item-media">
              <i class="icon icon-f7"></i>
            </div>
            <div class="item-inner">
              <div class="item-title">价格</div>
              <div class="item-after" id="price">
                
              </div>
            </div>
          </li>
          <li class="item-content">
            <div class="item-media">
              <i class="icon icon-f7"></i>
            </div>
            <div class="item-inner">
              <div class="item-title">次数</div>
              <div class="item-after" id="times">
                
              </div>
            </div>
          </li>
        </ul>
        <div class="card">
          <div class="card-header">简介</div>
          <div class="card-content">
            <div class="card-content-inner" id="dsc"></div>
          </div>
        </div>
        <div class="row btn-group">
          <div class="col-100">
            <a href="#" class="button button-big button-fill" onclick="productDetail.http('buy')">确认购买</a>
          </div>
        </div>
      </div>
    </div>

  </div>
  <!-- 底部 -->
  <!-- <nav class="bar bar-tab" id="golbalFooter"></nav> -->
  <div id="modal">

  </div>
  </div>
  <!-- 标题栏 -->

</body>
<script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
<script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
<script type="text/javascript" src="../js/index.js"></script>
<script type="text/javascript">
  var productDetail = (function ($) {
    $.init()
    var productDetail = new ST({
      golbalHeaderText: '次卡详情',
      golbalHeaderFunc: function () {
        window.history.back()
      },
    })
    var product = JSON.parse(decodeURI(productDetail.getLocationSearch('product')))
    for(var i in product) {
      $('#' + i).text(product[i])
    }
    productDetail.pushAjax({
      buy:{
        url:'/app/api/private/product/buy',
        data:{
          product:decodeURI(productDetail.getLocationSearch('product'))
        }
      }
    })

    productDetail.pushAjaxSuccess({
      buy:function (res) {
        if(res.code === '1'){
          window.location.href = './payOnline.html?orderId=' + res.data.order.orderId
        }
      }
    })
    productDetail.render()

    return productDetail
  })($)
</script>

</html>